﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PersonalAlbumModel>" %>

<asp:Content ID="registerContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <%=Model.Localize("Register.Title") %></h2>
    <p>
        <%=Model.Localize("Register.SubTitle") %>
    </p>
    <%= Html.ValidationSummary() %>
    <% using (Html.BeginForm("Register", "Account", FormMethod.Post, new { id = "RegistrationForm" }))
       { %>
    <%=Html.AntiForgeryToken()%>
    <div>
        <table>
            <tr>
                <td>
                    <%=Model.Localize("Register.UserName")%>:
                </td>
                <td>
                    <%= Html.TextBox("username", null, new { maxlength="20"})%>
                    <%= Html.ValidationMessage("username")%>
                </td>
            </tr>
            <tr>
                <td>
                    <%=Model.Localize("Register.Email")%>:
                </td>
                <td>
                    <%= Html.TextBox("email")%>
                    <%= Html.ValidationMessage("email")%>
                </td>
            </tr>
            <tr>
                <td>
                    <%=Model.Localize("Register.Password")%>:
                </td>
                <td>
                    <%= Html.Password("password", null, new  { maxlength="10" })%>
                    <%= Html.ValidationMessage("password")%>
                </td>
            </tr>
            <tr>
                <td>
                    <%=Model.Localize("Register.PasswordConfirm")%>:
                </td>
                <td>
                    <%= Html.Password("confirmPassword")%>
                    <%= Html.ValidationMessage("confirmPassword")%>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <input type="submit" value="<%=Model.Localize("Register.Submit") %>" />
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#RegistrationForm").validate({
                rules: {
                password: "required",
                confirmPassword: {
                        equalTo: "#password"
                    },
                    username:"required",
                    email: {
                        required: true,
                        email: true
                    }

                }
            });
        });
        

    </script>

    <% } %>
</asp:Content>
